package com.hspedu.Homework;
/*
 *@auther will
 *@version 1.0
 */

public class Homework01 {
    public static void main(String[] args) {
        String a=reverse("abcdef",2,4);
        System.out.println(a);
    }
    public static String reverse(String str,int start,int end){
        char temp=' ';
        char[] chars = str.toCharArray();
        for (int i =start ,j=end; i < j; i++,j--) {
            temp = chars[i];
            chars[i]=chars[j];
            chars[j]=temp;
        }
        return new String(chars);
    }
}

